extends Node2D
class_name Unit

@export var stats : UnitStats


# @onready var visuals : Node2D = %Visuals
@onready var sprite : Sprite2D = %Sprite2D
@onready var anim_player : AnimationPlayer = $AnimationPlayer

var anim_dir = "_down"

func animation_name(move_dir : Vector2, anim : String) -> String:
	if move_dir.x > 0 :
		anim_dir = "_right"
	elif move_dir.x < 0 :
		anim_dir = "_left"
	elif move_dir.y < 0 :
		anim_dir = "_up"
	elif move_dir.y > 0 :
		anim_dir = "_down"	
	return anim + anim_dir
